package test.test;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.itheima.mm_testApplication;
import com.itheima.test.entity.User;
import com.itheima.test3.controller.SubjectController;
import com.itheima.test3.entity.Subject;
import com.itheima.test3.mapper.SubjectMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;


/**
 * @description:7
 * @author: Java
 * @date: 2021/3/28 12:54
 */
@SpringBootTest(classes = mm_testApplication.class)
@RunWith(SpringRunner.class)
public class testSubject {
    @Autowired
    private SubjectMapper subjectMapper;

    @Test
    public void testSelect() {
        //看看select的语法
        //1.创建查询条件构建器
        QueryWrapper<Subject> wrapper = new QueryWrapper<>();
        //2.设置条件
        wrapper.eq("course_id", 1);
        List<Subject> subjectList = subjectMapper.selectList(wrapper);
        subjectList.forEach(System.out::println);
    }


}
